<?php
/**
 * Created by PhpStorm.
 * User: Nevena i Milena
 * Date: 2/22/14
 * Time: 5:06 PM
 */


class Student implements JsonSerializable{
    private $indeks;
    private $ime;
    private $prezime;
    private $smer;
    private $datum_rodjenja;

    function __construct( $indeks, $ime, $prezime, $smer, $datum_rodjenja)
    {
        $this->datum_rodjenja = $datum_rodjenja;
        $this->ime = $ime;
        $this->indeks = $indeks;
        $this->prezime = $prezime;
        $this->smer = $smer;
    }


    /**
     * @param mixed $ime
     */
    public function setIme($ime)
    {
        $this->ime = $ime;
    }

    /**
     * @return mixed
     */
    public function getIme()
    {
        return $this->ime;
    }

    /**
     * @param mixed $indeks
     */
    public function setIndeks($indeks)
    {
        $this->indeks = $indeks;
    }

    /**
     * @return mixed
     */
    public function getIndeks()
    {
        return $this->indeks;
    }

    /**
     * @param mixed $prezime
     */
    public function setPrezime($prezime)
    {
        $this->prezime = $prezime;
    }

    /**
     * @return mixed
     */
    public function getPrezime()
    {
        return $this->prezime;
    }

    /**
     * @param mixed $smer
     */
    public function setSmer($smer)
    {
        $this->smer = $smer;
    }

    /**
     * @return mixed
     */
    public function getSmer()
    {
        return $this->smer;
    }

    /**
     * @param mixed $datum_rodjenja
     */
    public function setDatumRodjenja($datum_rodjenja)
    {
        $this->datum_rodjenja = $datum_rodjenja;
    }
    /**
     * @return mixed
     */
    public function getDatumRodjenja()
    {
        return $this->datum_rodjenja;
    }

    public function expose(){
        return get_object_vars($this);
    }

    function __toString()
    {
        // TODO: Implement __toString() method.
        return $this->ime . " " . $this->prezime . " " . $this->indeks;
    }

    /**
     * (PHP 5 &gt;= 5.4.0)<br/>
     * Specify data which should be serialized to JSON
     * @link http://php.net/manual/en/jsonserializable.jsonserialize.php
     * @return mixed data which can be serialized by <b>json_encode</b>,
     * which is a value of any type other than a resource.
     */
    public function jsonSerialize()
    {
        return (object) get_object_vars($this);
    }
}



?>